import redis

from app.settings.config import REDIS_HOST, REDIS_PORT


def redis_init() -> redis.Redis:
    """
    初始化redis
    :return:
    """
    pool = redis.ConnectionPool(host=REDIS_HOST, port=REDIS_PORT)
    r_db = redis.Redis(connection_pool=pool)
    return r_db


r = redis_init()
